<?php
// +----------------------------------------------------------------------
// | @filename ArraySerializer.php
// +----------------------------------------------------------------------
// | @author 落花轻舞问君愁 <mwcx1990@qq.com>
// +----------------------------------------------------------------------
// | @datetime 2021-10-28 17:45:52
// +----------------------------------------------------------------------
// | @Description
// +----------------------------------------------------------------------

namespace App\Serializer;


class ArraySerializer extends \League\Fractal\Serializer\ArraySerializer
{
    public function collection($resourceKey, array $data)
    {
        return [$resourceKey ?: 'list' => $data];
    }

    public function meta(array $meta)
    {
        if (empty($meta)) {
            return [];
        }
        return $meta;
    }
}
